package com.zhidisoft.system.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

/**
 * 字典条目实体
 * @author Lu Jianliang
 *
 */
@SuppressWarnings("all")
@Entity
@Table(name="tb_system_dict")
public class Dict implements Serializable{
	
	private String id;

	/**
	 * 字典项目名：如男
	 */
	private String dictName;
	/**
	 * 字段项目值：如1
	 */
	private String dictValue;
	/**
	 * 字典项目编码：如male
	 */
	private String dictCode;
	/**
	 * 备注
	 */
	private String dictNote;
	/**
	 * 字典类型
	 */
	private DictType dictType;
	
	/**
	 * 记录创建时间
	 */
	private Date createTime;
	
	/**
	 * 记录创建者
	 */
	private User createUser;
	
	/**
	 * 记录更新时间
	 */
	private Date updateTime;
	
	/**
	 * 记录更新者
	 */
	private User updateUser;
	
	/**
	 * 记录状态
	 */
	private Integer status = 1;
	
	/**
	 * 排序数值，数值越大排序越靠前
	 */
	private Integer sortNum = 0;
	
	/**
	 * 版本控制值
	 */
	private Integer version;

	@Id
	@GeneratedValue(generator="system-uuid")
	@GenericGenerator(name="system-uuid",strategy="uuid")
	public String getId() {
		return id;
	}

	@Column(length=50,nullable=false)
	public String getDictName() {
		return dictName;
	}

	@Column(length=50,nullable=false)
	public String getDictValue() {
		return dictValue;
	}

	@Column(length=50,nullable=false)
	public String getDictCode() {
		return dictCode;
	}

	@Column(length=200)
	public String getDictNote() {
		return dictNote;
	}

	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="typeId")
	public DictType getDictType() {
		return dictType;
	}

	public void setId(String id){
		this.id = id;
	}
	
	public void setDictName(String dictName) {
		this.dictName = dictName;
	}

	public void setDictValue(String dictValue) {
		this.dictValue = dictValue;
	}

	public void setDictCode(String dictCode) {
		this.dictCode = dictCode;
	}

	public void setDictNote(String dictNote) {
		this.dictNote = dictNote;
	}

	public void setDictType(DictType dictType) {
		this.dictType = dictType;
	}
	
}
